<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCruiseTaskProjectTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_task_project', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('categoryId')->default(0)->comment('分类表id');
            $table->string('name', 32)->default('')->comment('项目名称');
            $table->unsignedTinyInteger('status')->default(0)->comment('使用状态 0否 1是');
            $table->string('tipsType', 32)->default('')->comment('提示类型 空/string/imgGroup');
            $table->string('tipsContent', 512)->default('')->comment('提示内容：文字、图片数组');
            $table->string('inputType', 32)->default('')->comment('类型');
            $table->string('inputField', 64)->default('')->comment('字段field');
            $table->string('inputObject', 2048)->default('')->comment('input对象');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->unsignedTinyInteger('isDeleted')->default(0);
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '巡店 - 任务项目';

            $table->index('categoryId', 'idx_categoryId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cruise_task_project');
    }
}
